package com.senney.service.impl;

import com.senney.bean.UserAddress;
import com.senney.service.UserService;
import org.apache.dubbo.config.annotation.DubboService;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

@DubboService
public class UserServiceImpl implements UserService {
    @Override
    public List<UserAddress> getUserAddressList(String userId) {
        UserAddress addr1 = new UserAddress(1,"上海市松江区文汇路300弄","1","Lanm","13479193111","Y");
        UserAddress addr2 = new UserAddress(2,"上海市浦东新区高科西路2111弄","2","Senney","13479923239","Y");

        return Arrays.asList(addr1,addr2).stream().filter(x->x.getUserId().equals(userId)).collect(Collectors.toList());
    }
}
